package edu.odu.cs.sstore.dto;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.NumberFormat;

public class UserDTO implements Serializable {
	
	private static final long serialVersionUID = -1356164633987361284L;
	
	private Long id;
	
	@NotEmpty(message="University ID is required")
	private String username;
	
	@NotEmpty(message="Name is required")
	private String name;
	
	private Set<String> authorities;
	private String password;
	
	public UserDTO() {
		this.username = null;
		this.name = null;
		this.id = null;
		this.authorities = new HashSet<String>();
	}
	
	public UserDTO(Long id, String username, String name, Set<String> authorities) {
		this.id = id;
		this.name = name;
		this.username = username;
		this.authorities = authorities;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	public Long getId() {
		return this.id;
	}
	
	public String getUsername() {
		return this.username;
	}
	
	public void setUsername(String username) {
		this.username = username;
	}
	
	public String getName() {
		return this.name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public void setAuthorities(Set<String> authorities) {
		this.authorities = authorities;
	}

	public Set<String> getAuthorities() {
		return this.authorities;
	}
	
	public String getPassword() {
		return this.password;
	}
	
	public void setPassword(String password) {
		this.password = password;
	}
}
